//
//  VRDefine.h
//  VR
//
//  Created by hxp on 16/3/12.
//  Copyright © 2016年 hxp. All rights reserved.
//

#ifndef VRDefine_h
#define VRDefine_h


#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height

#define kScreenWidth     ([UIScreen mainScreen].bounds.size.width)//([UIScreen mainScreen].currentMode.size.width / ScreenScale)
#define kScreenHeight    [UIScreen mainScreen].bounds.size.height//([UIScreen mainScreen].currentMode.size.height / ScreenScale)

#define WeakSelf(weakSelf)      __weak __typeof(&*self)weakSelf = self;
//#define StrongSelf(strongSelf)  __strong __typeof(&*self)strongSelf = self; why??

//http://holko.pl/2015/05/31/weakify-strongify/
#define weakify(var) __weak typeof(var) AHKWeak_##var = var;

#define strongify(var) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
__strong typeof(var) var = AHKWeak_##var; \
_Pragma("clang diagnostic pop")


// 自动以全局宏
//
/** 登录 */
#define VRLoginCookieKey @"loginCookie"
#define VRManagerKey @"managerKey"
#define  VRManagerMobile @"mobileKey"
/**
 *  保存位置信息的key，保存为字典类型
 locDcit:{
	locality : 杭州市,
	administrativeArea : 浙江省,
	latitude : 30.26724521944026,
	longitude : 120.1020869588854,
	areacode : 330100
 }
 */



// 自定义Log
#ifdef DEBUG
#define VRLog(...) NSLog(__VA_ARGS__)
#else
#define VRLog(...)
#endif

#define ScreenScale (SCREEN_WIDTH / 375.0)
#define FontWithScale(font) ((font)*(1 + ScreenScale)*0.5)
/** 系统版本号 */
#define SystemVersion [[[UIDevice currentDevice] systemVersion] floatValue]
// rgb颜色
#define VRColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define VRColorAlpha(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/1.0]
#define RGB(r, g, b)                        [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
#define RGBA(r, g, b, a)                    [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
/**
 *  细字体， 黑体：'Heiti SC'、'Heiti TC'。
 Heiti SC
 STHeitiSC-Light
 STHeitiSC-Medium
 
 Heiti TC
 STHeitiTC-Light
 STHeitiTC-Medium
 
 Hiragino Kaku Gothic ProN
 HiraKakuProN-W3
 HiraKakuProN-W6Hiragino
 
 Mincho ProN
 HiraMinProN-W3
 HiraMinProN-W6
 */
//#define VRFont(s)  [UIFont fontWithName:@"PingFangSC-Regular" size:(s)]
#define VRFont(s)  [UIFont fontWithName:@"PingFangSC-Regular" size:(s)]

/** 导航栏颜色 */
#define NAVColor RGBA(254, 217, 83, 0.98)
/** 主色调 */
#define MAINColor RGBA(254, 217, 83, 1)
#define ScorllViewBgColor RGB(245, 245, 245)


// 判断是否是iPhone X
#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
// 状态栏高度
#define STATUS_BAR_HEIGHT (iPhoneX ? 44.f : 20.f)
// 导航栏高度
#define NAVIGATION_BAR_HEIGHT (iPhoneX ? 88.f : 64.f)
// tabBar高度
#define TAB_BAR_HEIGHT (iPhoneX ? (49.f+34.f) : 49.f)
// home indicator
#define HOME_INDICATOR_HEIGHT (iPhoneX ? 34.f : 0.f)


#define MainColor RGB(254, 216, 84)

/** 添加账目通知通知 */
#define kAddAccountNotificationName @"AddAccountNotificationName"
/** 声音开关 */
#define kVoiceSwitchIsCloseKey @"VoiceSwitchKey"
/** 明细详情开关 */
#define kShowDetailSwitchIsCloseKey @"IsShowDetailKey"


/** 数聚魔盒key */
#define kPartner_code @"xiaoxubao_mohe"
#define kPartner_key @"d0530f2b363d4cf2bb8f5edc2f6754e4"


/** 苹果首页传参跳转 */
#define API_jumpPage @"http://www.51xintiao.cn/indexs"
/** 信条首页url */
#define API_homeUrl @"https://www.51xintiao.cn/mobile/jiekuan.htm"
/** 上传通讯录 */
//#define API_upLoadContact @"http://xt.365yama.cn/submits"
#define API_upLoadContact @"http://xt.365yama.cn/ansubmit"

/** 上传地理位置 */
#define API_upLoadLocation @"http://xt.365yama.cn/andlwz"
/** 刷新地址 */
//#define API_upRefreshUrl @"https://www.51xintiao.cn/muser/myZl.htm"
/** 上传图片 */
#define API_uploadImageUrl @"http://xt.365yama.cn/muser/mySfsbys_ajax.action"
/** 上传身份证认证成功刷新 */
//#define API_authenticationSuccessUrl @"https://www.51xintiao.cn/muser/mySmrz.htm"



#endif /* VRDefine_h */
